package com.guan.ordering_sys.generator.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.guan.ordering_sys.generator.entity.Order;
import com.guan.ordering_sys.generator.mapper.OrderMapper;
import com.guan.ordering_sys.generator.service.OrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guan.ordering_sys.vo.DingdanVo;
import com.guan.ordering_sys.vo.SingleCheckVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 韩思琪
 * @since 2021-06-18
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

    @Autowired
    OrderMapper orderMapper;

    @Override
    public IPage<DingdanVo> orderList(Page<DingdanVo> dingdanVoPage) {
        IPage<DingdanVo> DingdanVoIPage = orderMapper.selectOrderList(dingdanVoPage);
        return DingdanVoIPage;
    }

    @Override
    public SingleCheckVo getSingleCheck(int orderId) {
        SingleCheckVo singleCheckVo = orderMapper.getSingleCheck(orderId);
        return singleCheckVo;
    }

    @Override
    public int updateCheck(int orderId, String payType) {
        int updateResult = orderMapper.updateCheck(orderId,payType);
        return updateResult;
    }
}
